import request from '@/utils/request'

export function getRoleAll() {
  return request({
    url: '/admin/role/listALL',
    method: 'get'
  })
}


export function getRoleList(data) {
  return request({
    url: '/admin/role/page',
    method: 'get',
    params: data
  })
}


export function getRole(id) {
  return request({
    url: '/admin/role/' + id,
    method: 'get'
  })
}

export function updateRole(data) {
  return request({
    url: '/admin/role',
    method: 'put',
    data
  })
}

/**
 * 保存角色
 * @param {角色} data
 */
export function saveRole(data) {
  return request({
    url: '/admin/role',
    method: 'post',
    data
  })
}

/**
 *  删除角色
 * @param {id} id
 */
export function delRole(id) {
  return request({
    url: '/admin/role/' + id,
    method: 'delete'
  })
}
